package com.small.nacos.common.notify.listener;

import com.small.nacos.common.notify.Event;

import java.util.concurrent.Executor;

/**
 * @Author zhoujin
 * @Date 2022/11/7 14:11
 */
public abstract class Subscriber<T extends Event> {

    /**
     * Event callback.
     *
     * @param event {@link Event}
     */
    public abstract void onEvent(T event);

    /**
     * Type of this subscriber's subscription.
     *
     * @return Class which extends {@link Event}
     */
    public abstract Class<? extends Event> subscribeType();


    public Executor executor() {
        return null;
    }
}
